<!--
 * @Author: wangzhichiao<https://github.com/wzc570738205>
 * @Date: 2020-05-25 14:58:08
 * @LastEditors: wangzhichiao<https://github.com/wzc570738205>
 * @LastEditTime: 2020-05-27 09:37:47
 -->
<template>
  <div class="action_bar">
    <el-form :inline="true" :model="form" class="demo-form-inline">
      <template v-for="(item, index) in tableSeting">
        <el-form-item :label="item.title" :key="index" v-if="item.isSearch">
          <el-input v-model="form.user" placeholder="审批人"></el-input>
        </el-form-item>
      </template>

      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          @click="$emit('search-click', form)"
          >搜索</el-button
        >
        <el-button
          type="primary"
          icon="el-icon-circle-plus-outline"
          @click="$emit('insert-click')"
          >新增</el-button
        >
        <!--      <el-button type="primary" icon="el-icon-edit" @click="$emit('edit-click')"
        >编辑</el-button
      > -->
        <el-button
          type="danger"
          icon="el-icon-delete"
          @click="$emit('delete-click')"
          >删除</el-button
        >
      </el-form-item>
    </el-form>
    <!--     <div class="search">
      <el-input
        class="input"
        v-model="form.formName"
        placeholder="表单名称"
        clearable
        @keyup.enter.native="$emit('search-click', form)"
      />
    </div>
    <div class="button_group">
      <el-button
        type="primary"
        icon="el-icon-search"
        @click="$emit('search-click', form)"
        >搜索</el-button
      >
      <el-button
        type="primary"
        icon="el-icon-circle-plus-outline"
        @click="$emit('insert-click')"
        >新建表单</el-button
      >
      <el-button type="primary" icon="el-icon-edit" @click="$emit('edit-click')"
        >编辑</el-button
      >
      <el-button
        type="primary"
        icon="el-icon-delete"
        @click="$emit('delete-click')"
        >删除</el-button
      >
    </div> -->
  </div>
</template>

<script>
export default {
  props: {
    tableSeting: {
      type: Array,
      required: true,
      default: () => []
    }
  },
  data() {
    return {
      form: {
        formName: ''
      }
    }
  }
}
</script>

<style lang="stylus" scoped>
.action_bar
  display flex
  .search
    display flex
    .input
      margin-right 10px
      max-width 300px
</style>
